package top.wardyan.wbaseswt.conf.model;

import org.eclipse.swt.SWT;

@SuppressWarnings("serial")
public class YTTableCol extends MasterModel<YTTableCol>{

	public static final YTTableCol dao = new YTTableCol().dao();
	
	
	
	@Override
	public String tableName() {
		return "yt_tablecol";
	}

	
	@Override
	public Status getSStatus() {
		return Status.getInstance(this.getInt("sStatus") != null ? this.getInt("sStatus") : 1);
	}
	
	public int getSIndex() {
		return this.getInt("sIndex") != null ? this.getInt("sIndex") : 0;
	}
	public YTTableCol setSIndex(int sIndex) {
		this.set("sIndex", sIndex);
		return this;
	}
	public String getXClassName() {
		return this.getStr("xClassName");
	}
	public YTTableCol setXClassName(String xClassName) {
		this.set("xClassName", xClassName);
		return this;
	}
	public String getXTableName() {
		return this.getStr("xTableName");
	}
	public YTTableCol setXTableName(String xTableName) {
		this.set("xTableName", xTableName);
		return this;
	}
	public String getXField() {
		return this.getStr("xField");
	}
	public YTTableCol setXField(String xField) {
		this.set("xField", xField);
		return this;
	}
//	public String getXName() {
//		return this.getStr("xName");
//	}
//	public YTTableCol setXName(String xName) {
//		this.set("xName", xName);
//		return this;
//	}
//	
//	public int getXType() {
//		return this.getInt("xType") != null ? this.getInt("xType") : 1;
//	}
//	public YTTableCol setXType(int xType) {
//		this.set("xType", xType);
//		return this;
//	}
	
	
	/** 默认列宽64 **/
	public int getXWidth() {
		return this.getInt("xWidth") != null ? this.getInt("xWidth") : 64;
	}
	public YTTableCol setXWidth(int xWidth) {
		this.set("xWidth", xWidth);
		return this;
	}
	
	public int getXAlign() {
		return this.getInt("xAlign") != null ? this.getInt("xAlign") : SWT.LEFT;
	}
	public YTTableCol setXAlign(int xAlign) {
		this.set("xAlign", xAlign);
		return this;
	}
	public String getXFormat() {
		return this.getStr("xFormat");
	}
	public YTTableCol setXFormat(String xFormat) {
		this.set("xFormat", xFormat);
		return this;
	}
	
	public int getXType() {
		return this.getInt("xType") != null ? this.getInt("xType") : 0;
	}
	public YTTableCol setXType(int xType) {
		this.set("xType", xType);
		return this;
	}
}
